<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="renderer" content="webkit">

    <title>查看匠人信息</title>

    <meta name="keywords" content="">
    <meta name="description" content="">

    <!--[if lt IE 9]>
    <meta http-equiv="refresh" content="0;ie.html" />
    <![endif]-->

    <link rel="shortcut icon" href="favicon.ico"> <link href="__STATIC__/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="__STATIC__/css/font-awesome.min.css?v=4.4.0" rel="stylesheet">
    <link href="__STATIC__/css/animate.css" rel="stylesheet">
    <link href="__STATIC__/css/style.css?v=4.1.0" rel="stylesheet">
    <style type="text/css">
        div{
            text-align: center;
        }
        th{
            text-align: center;
        }
        .fanye{
            text-align: center;
        }
    </style>
</head>
<body>
    <div class="ibox-title">
        <h5>查看匠人信息</h5>
    </div>
    <form class="form-horizontal m-t" id="signupForm" action="{:url('getChoose')}" method="post" enctype="multipart/form-data">
        <div class="form-group">
            <label class="col-sm-1 control-label">茶类</label>
            <div class="col-sm-2">
                <select class="form-control m-b " name="teacase" style="font-size: 12px;">
                    <option value="10000">查看全部</option>
                    {foreach $teacase as $case}
                    <option value="{$case['id']}">{$case['teaname']}</option>
                    {/foreach}
                    <option value="9999">其它</option>
                </select>
            </div>

            <label class="col-sm-1 control-label">产区</label>
            <div class="col-sm-2">
                <select class="form-control m-b" name="teaarea" style="font-size: 12px;">
                    <option value="10000">查看全部</option>
                </select>
            </div>
            <div class="col-sm-2">
                <button class="btn btn-primary" type="submit">提交</button>
            </div>
        </div>
    </form>

<!-- 全局js -->
<script src="__STATIC__/js/jquery.min.js?v=2.1.4"></script>
<script src="__STATIC__/js/bootstrap.min.js?v=3.3.6"></script>
<script src="__STATIC__/js/plugins/metisMenu/jquery.metisMenu.js"></script>
<script src="__STATIC__/js/plugins/slimscroll/jquery.slimscroll.min.js"></script>
<script src="__STATIC__/js/plugins/layer/layer.min.js"></script>

<!-- 自定义js -->
<script src="__STATIC__/js/hAdmin.js?v=4.1.0"></script>
<script type="text/javascript" src="__STATIC__/js/index.js"></script>

<!-- 第三方插件 -->
<script src="__STATIC__/js/plugins/pace/pace.min.js"></script>
<script type="text/javascript">
    $("select[name=teacase] ").change(function(){
        var val = $(this).find("option:selected").attr("value");
        if(val == 10000){
            var inner = "<option value="+10000+">查看全部</option>";
            $("select[name=teaarea]").html(inner);
            exit();
        }
        if(val == 9999){
            var a = "<option value="+9999+">其它</option>";
            $("select[name=teaarea]").html(a);
            exit();
        }

        var url="{:url('reTeaAreaJson')}";
        $.post(url, {teacase_id:val},function(data){
            var areas = JSON.parse(data);
            var option="<option value='10000'>查看全部</option>";
            for(index in areas){
                var a = "<option value="+areas[index]['id']+">"+areas[index]['area']+"</option>"
                option +=a;
            }
            option += "<option value='9999'>其它</option>";
            $("select[name=teaarea]").html(option)
        })
    })

</script>



</body>
</html>